Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Currently only uncommitted changes are shown. This changes the behavior to show all committed and uncommitted changes from the branch point when on a feature branch, while maintaining the existing behavior (uncommitted only) on the default branch.

Implementation

  • Branch detection: Check for main then master to identify default branch
  • Feature branches: Use git diff <default>...HEAD to show all changes since branching
  • Default branch: Continue using git diff HEAD to show only uncommitted changes
  • Untracked files: Included in both cases

Example

On feature branch feature-1:

diff --git a/./feature-file-1.txt b/./feature-file-1.txt  # committed change
+Committed change 1
diff --git a/./uncommitted.txt b/./uncommitted.txt      # uncommitted change
+Uncommitted change

On master branch:

diff --git a/./uncommitted.txt b/./uncommitted.txt      # only uncommitted
+Uncommitted change
# committed changes not shown

Tests Added

  • TestServeDiffsText_FeatureBranchShowsAllChanges: Verifies committed + uncommitted changes shown on feature branches
  • TestServeDiffsText_MasterBranchShowsOnlyUncommitted: Verifies only uncommitted changes shown on default branch
Original prompt

Current solution shows uncommitted differences. I actually think we need to show all differences both committed and uncommitted from the branch point of the directory. If the directory is on the default branch either master or main typically then we can only show the uncommitted changes.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copilot AI changed the title [WIP] Update difference display for committed and uncommitted changes Show all changes from branch point on feature branches Nov 17, 2025
Copilot AI requested a review from alexec November 17, 2025 15:19
@alexec alexec marked this pull request as ready for review November 17, 2025 15:43
@alexec alexec enabled auto-merge (squash) November 17, 2025 15:43
@alexec alexec merged commit a9ebe49 into main Nov 17, 2025
2 checks passed
@alexec alexec deleted the copilot/show-all-differences branch November 17, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants